package com.icode.core.shared;

import com.icode.core.model.manage.SellManager;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-8-15
 * Time: 下午4:14
 * To change this template use File | Settings | File Templates.
 */
public class SellManagerHandle {

    public static void operate(SellManager sellManager, String type) {
        if ("gold".equals(type)) {
            if (sellManager.gold() > 0) {
                sellManager.initGold(sellManager.gold() - 1);
            }
        } else if ("busy".equals(type)) {
            if (sellManager.busy() > 0) {
                sellManager.initBusy(sellManager.busy() - 1);
            }
        } else if ("slack".equals(type)) {
            if (sellManager.slack() > 0) {
                sellManager.initSlack(sellManager.slack() - 1);
            }
        } else if ("common".equals(type)) {
            if (sellManager.common() > 0) {
                sellManager.initCommon(sellManager.common() - 1);
            }
        }
    }
}
